package com.giveu.signature.config;

import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.cache.RedisCacheManager;
import org.springframework.data.redis.core.StringRedisTemplate;

@Configuration
@EnableCaching
public class CacheConfig {
	
	@Bean
	public CacheManager cacheManager(StringRedisTemplate stringRedisTemplate){
		RedisCacheManager redisCache = new RedisCacheManager(stringRedisTemplate);
		redisCache.setDefaultExpiration(60*60*24);
		return redisCache;
	}
}
